//
//  Test.c
//  CircleQueue
//
//  Created by Xavier on 2023/10/24.
//

#include "CQueueList.h"
int main(int argc, const char * argv[]) {
    CQueue* cq = circularQueueInit(4);
    if (-1 == circularQueueIsEmpty(cq)) printf("队空\n");
    circularQueuePush(cq, 1);
    circularQueuePush(cq, 2);
    circularQueuePush(cq, 3);
    circularQueuePush(cq, 4);
    if (-1 == circularQueueIsFull(cq)) printf("队满\n");
    circularPrint(cq);
    
    //if (-1 == circularQueueIsEmpty(cq)) printf("队空\n");
    //if (-1 == circularQueueIsFull(cq)) printf("队满\n");
//    printf("判断循环队列是否为空，为空输出-1，非空输出1: %d\n",circularQueueIsEmpty(cq));
//    printf("判断循环队列是否已满，满了输出-1，没满输出1: %d\n",circularQueueIsFull(cq));
    circularQueuePop(cq);
    circularPrint(cq);
    printf("获取队头元素,为空返回-1:%d\n", circularQueueFront(cq));
    printf("获取队尾元素,为空返回-1:%d\n", circularQueueRear(cq));
    
}
